<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<title>产品详情</title>
	<meta th:replace="admin/template/head.html"/>
	<script type="text/javascript" charset="utf-8" th:src="@{/static/plugins/ueditor/ueditor.config.js}"></script>
	<style>
		img {
			width: 80px;
			height: 80px;
		}
		video {
			height: 300px;
			width: 500px;
		}
	</style>
</head>
<body>

<form class="layui-form" action="" id="form1">
	<br>
	<div class="layui-form-item" style="display: none;">
		<div class="layui-inline">
			<label class="layui-form-label">ID</label>
			<div class="layui-input-inline">
				<input disabled readonly th:value="${product?.id}" autocomplete="off" class="layui-input" >
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">名称</label>
			<div class="layui-input-inline">
				<input disabled readonly th:value="${product?.title}" autocomplete="off" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">分类名称</label>
			<div class="layui-input-inline">
				<input disabled readonly th:value="${product?.categoryName}" autocomplete="off" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">指导价</label>
			<div class="layui-input-inline">
				<input disabled readonly th:value="${product?.guidePrice}" autocomplete="off" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">最低价</label>
			<div class="layui-input-inline">
				<input disabled readonly th:value="${product?.lowestPrice}" autocomplete="off" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">封面</label>
			<div class="layui-input-inline">
				<div th:class="${product?.cover}? '' : 'layui-hide'" id="uploadDemoView">
					<img th:src="${uriPrefix + product?.cover}" alt="上传成功后渲染" style="max-width: 196px">
				</div>
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<div class="layui-upload" style="margin-left: 110px">
				<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
					实景图预览：
					<div class="layui-upload-list" id="demo2">
						<img th:if="${!product?.filesPath.isEmpty()}" th:src="${uriPrefix + path}" th:each="path:${product?.filesPath}">
					</div>
				</blockquote>
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">视频</label>
			<div class="layui-input-inline">
				<div th:class="${!#strings.isEmpty(product?.videoPath)}? '' : 'layui-hide'">
					<video th:if="${!#strings.isEmpty(product?.videoPath)}" controls th:src="${uriPrefix + product?.videoPath}" ></video>
				</div>
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">图文详情</label>
			<div class="layui-input-inline">
				<div >
					<script id="editor" type="text/plain" style="width:700px;height:500px;" th:utext="${product?.description}"></script>
				</div>
			</div>
		</div>
	</div>

</form>
<script type="text/javascript" charset="utf-8" th:src="@{/static/plugins/ueditor/ueditor.all.min.js}"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" th:src="@{/static/plugins/ueditor/lang/zh-cn/zh-cn.js}"></script>
<script>
	//实例化编辑器
	//建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
	var ue = UE.getEditor('editor');
	ue.addListener("ready", ()=> {});
	ue.ready(function () {
		ue.setDisabled();
	})
</script>
</body>
</html>